package com.java.util.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {

		registry.addInterceptor(new AdminInterceptor()).addPathPatterns("/admin/**")
		.excludePathPatterns("/admin/signin", "/admin/logon");
		
		registry.addInterceptor(new UserInterceptor()).addPathPatterns("/user/**")
		.excludePathPatterns("/user/signin", "/user/signup", "/user/logon", "/user/register");
	}
}